home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: jhewett@ix.netcom.com (Jerry Hewett)
- Newsgroups: comp.lang.c++
- Subject: Re: const FAR* for a DLL
- Date: Mon, 08 Apr 96 16:32:54 GMT
- Organization: Netcom
- Message-ID: <N.040896.093254.68@ix.netcom.com>
- References: <828873144.24425@uribe.demon.co.uk>
- NNTP-Posting-Host: tem-ca1-18.ix.netcom.com
- X-NETCOM-Date: Mon Apr 08 11:33:25 AM CDT 1996
- X-Newsreader: Quarterdeck Message Center [2.00]
-
- > Below is an exctract from a DLL I am trying to write. The 2nd parameter
- > for FillRect is defined in windows.h as const RECT FAR* Could somebody
- > PLEASE tell me how to set it up - I've tried everything I can think of,
- > plus a few suggestions from others with no success so far.
-
- Try this (I didn't compile/test it, but it should work :-)
-
- ----<snip>----
-
- int FAR PASCAL _export myShow(int dest)
- {
- RECT rc;
- int i;
- long colour;
- BYTE bRed,bGrn,bBlu;
-
- // colour below is assumed to be GREEN; 0x0000FF00 (page 101)
-
- colour = 0xFF00;
-
- // mask colour out to BGR byte values (page 101)
-
- bBlu = (BYTE) (colour & 0xFF0000);
- bGrn = (BYTE) (colour & 0x00FF00);
- bRed = (BYTE) (colour & 0x0000FF);
-
- // set up a 100x100 rectangle at 10,10 (page 153)
-
- rc.left = 10;
- rc.top = 10;
- rc.right = 100;
- rc.bottom = 100;
-
- // ...assuming that "dest" is a handle to a device context (page 155)
-
- i = FillRect (dest,&rc,CreateSolidBrush (RGB (bRed,bGrn,bBlu)));
-
- return i;
- }
-
- ----<snip>----
-
- At the risk of sounding like a parrot or paid flunky of MS Press (which I'm
- not), pick up a copy of Charles Petzold's _Programming Windows 95_. You'll
- never regret it. The information above was culled from pages 101 and 151-156
- of _PW95_.
-
- Jerry H.
-
-
-